package com.mt.mall.entity.User;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import com.mt.common.system.entity.User;

@DEntity(label="收获地址",comment="",moduleLabel="收货地址")
@Entity(name="mall_shipping_address")
@Table(name = "mall_shipping_address" , indexes = { @Index(name = "index_user_id", columnList = "user_id")  })
@ApiModel(description = "收获地址:")
public class ShippingAddress extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="用户",foreignEntity="User",comment="",component="对象选择",where=true)
	@ApiModelProperty(value = "用户:")
	@Column(name="user_id",length=255,nullable=false,unique=false)
	private Long userId;

	@Transient
	private User user;

	@Transient
	@ApiModelProperty(value = "用户名称:")
	@DColumn(index=3,label="用户",foreignEntity="User",comment="")
	private String userName;

	@DColumn(index=4,label="收件人",comment="收件人",component="文本",where=true)
	@ApiModelProperty(value = "收件人:收件人")
	@Column(name="recipient",length=20,nullable=false,unique=false)
	private String recipient;

	@DColumn(index=4,label="电话号码",comment="电话号码",component="文本",where=true)
	@ApiModelProperty(value = "电话号码:电话号码")
	@Column(name="phone",length=20,nullable=false,unique=false)
	private String phone;

	@DColumn(index=5,label="所在地区",comment="地区划分四川省-资阳市",component="文本",where=true)
	@ApiModelProperty(value = "所在地区:地区划分四川省-资阳市")
	@Column(name="area",length=255,nullable=false,unique=false)
	private String area;

	@DColumn(index=6,label="详细地址",comment="详细地址",component="文本",where=false)
	@ApiModelProperty(value = "详细地址:详细地址")
	@Column(name="detailed_address",length=255,nullable=true,unique=false)
	private String detailedAddress;

	@DColumn(index=7,label="是否默认地址",comment="是否默认地址",component="switch",where=false)
	@ApiModelProperty(value = "默认地址:默认地址")
	@Column(name="default_address",length=10,nullable=true,unique=false)
	private Boolean defaultAddress;

	public Boolean getDefaultAddress() {
		return defaultAddress;
	}

	public void setDefaultAddress(Boolean defaultAddress) {
		this.defaultAddress = defaultAddress;
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getArea() {
		return this.area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getDetailedAddress() {
		return this.detailedAddress;
	}

	public void setDetailedAddress(String detailedAddress) {
		this.detailedAddress = detailedAddress;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		if(user == null){
		}
		else
		{
		this.userId = user.getEid();
		this.user = user;		
		}
}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}



}
